3.433 \(\int \sec ^2(c+d x) (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=28 \[ \frac{a \tan (c+d x)}{d}+\frac{b \tan ^3(c+d x)}{3 d} \]

[Out]

(a*Tan[c + d*x])/d + (b*Tan[c + d*x]^3)/(3*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0289415, antiderivative size = 28, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.048, Rules used = {3675} \[ \frac{a \tan (c+d x)}{d}+\frac{b \tan ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2*(a + b*Tan[c + d*x]^2),x]

[Out]

(a*Tan[c + d*x])/d + (b*Tan[c + d*x]^3)/(3*d)

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps

\begin{align*} \int \sec ^2(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \left (a+b x^2\right ) \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{a \tan (c+d x)}{d}+\frac{b \tan ^3(c+d x)}{3 d}\\ \end{align*}

Mathematica [A]  time = 0.0109921, size = 28, normalized size = 1. \[ \frac{a \tan (c+d x)}{d}+\frac{b \tan ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2*(a + b*Tan[c + d*x]^2),x]

[Out]

(a*Tan[c + d*x])/d + (b*Tan[c + d*x]^3)/(3*d)

________________________________________________________________________________________

Maple [A]  time = 0.038, size = 33, normalized size = 1.2 \begin{align*}{\frac{1}{d} \left ({\frac{b \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{3\, \left ( \cos \left ( dx+c \right ) \right ) ^{3}}}+a\tan \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2*(a+b*tan(d*x+c)^2),x)

[Out]

1/d*(1/3*b*sin(d*x+c)^3/cos(d*x+c)^3+a*tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.12524, size = 34, normalized size = 1.21 \begin{align*} \frac{b \tan \left (d x + c\right )^{3} + 3 \, a \tan \left (d x + c\right )}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/3*(b*tan(d*x + c)^3 + 3*a*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.48839, size = 92, normalized size = 3.29 \begin{align*} \frac{{\left ({\left (3 \, a - b\right )} \cos \left (d x + c\right )^{2} + b\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/3*((3*a - b)*cos(d*x + c)^2 + b)*sin(d*x + c)/(d*cos(d*x + c)^3)

________________________________________________________________________________________

Sympy [A]  time = 1.76578, size = 36, normalized size = 1.29 \begin{align*} \begin{cases} \frac{a \tan{\left (c + d x \right )} + \frac{b \tan ^{3}{\left (c + d x \right )}}{3}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \tan ^{2}{\left (c \right )}\right ) \sec ^{2}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2*(a+b*tan(d*x+c)**2),x)

[Out]

Piecewise(((a*tan(c + d*x) + b*tan(c + d*x)**3/3)/d, Ne(d, 0)), (x*(a + b*tan(c)**2)*sec(c)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.46188, size = 34, normalized size = 1.21 \begin{align*} \frac{b \tan \left (d x + c\right )^{3} + 3 \, a \tan \left (d x + c\right )}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/3*(b*tan(d*x + c)^3 + 3*a*tan(d*x + c))/d